package com.epoint.mobileoa.ui.wsgw.bizlogic;

import java.util.List;

import com.epoint.mobileoa.ui.wsgw.model.FlowInfoModel;

/**
 * @author liyc
 * @time 2012-12-18 上午11:40:33
 * @annotation 
 */
public class StringDeal {
	
	public static String getBZ(String title)
	{
		if(title.startsWith("【"))
		{
			int rindex = title.indexOf("】");
			return title.substring(0, rindex+1);
		}
		else{
			return "";
		}
	}
	
	public static String pingProcessXML_WS(List<FlowInfoModel> alist) {
		String logHtml = "";
		String center = "<div align=\"center\">";
		String fontcolor = "black";
		String titlecolor = "#9A32CD";
		logHtml += "<table width='100%'  border=\"0\" cellspacing=\"1\" style=\"background-color:#a0c6e5\">";
		logHtml += "<tr bgcolor=\"#CCCCCC\">";
		logHtml += "<td>" + center + "<font color=" + titlecolor
				+ " size=1>步骤</font></td>";
		logHtml += "<td>" + center + "<font color=" + titlecolor
				+ " size=1>办理人员</font></td>";
		logHtml += "<td>" + center + "<font color=" + titlecolor
				+ " size=1>收到时间</font></td>";
//		logHtml += "<td>" + center + "<font color=" + titlecolor
//				+ " size=1>阅读时间</font></td>";
		logHtml += "<td>" + center + "<font color=" + titlecolor
				+ " size=1>处理时间</font></td>";
		logHtml += "<td>" + center + "<font color=" + titlecolor
				+ " size=1>办理意见</font></td>";
//		logHtml += "<td>" + center + "<font color=" + titlecolor
//				+ " size=1>提交人</font></td>";
		logHtml += "</tr>";
		for (int i = 0; i < alist.size(); i++) {
			String bgcolor = "#F0F0F0";
			if (i % 2 == 0) {
				bgcolor = "#FFF0F5";// 淡红
			}

			logHtml += "<tr bgcolor=" + bgcolor + ">";
			logHtml += "<td  >" + center + "<font color=" + fontcolor
					+ " size=2>" + alist.get(i).ActivityName + "</font></td>";// 步骤
			logHtml += "<td>" + center + "<font color=" + fontcolor
					+ " size=1>" + alist.get(i).HandleUserName + "</font></td>";// 办理人员
			logHtml += "<td>" + center + "<font color=" + fontcolor
					+ " size=1>" + alist.get(i).ReceiveDateTime + "</font></td>";// 收到时间

//			logHtml += "<td>" + center + "<font color=" + fontcolor
//					+ " size=1>" + alist.get(i).readDate + "</font></td>";// 阅读时间
			logHtml += "<td>" + center + "<font color=" + fontcolor
					+ " size=1>" + alist.get(i).HandleDateTime + "</font></td>";// 处理时间
			logHtml += "<td>" + center + "<font color=" + fontcolor
					+ " size=1>" + alist.get(i).Opinion + "</font></td>";// 办理意见
//			logHtml += "<td>" + center + "<font color=" + fontcolor
//					+ " size=1>" + alist.get(i).senderName + "</font></td>";// 提交人
			logHtml += "</tr>";
		}
		logHtml += "</table>";
		logHtml += "<br>";
		logHtml += "<br>";
		return logHtml;
	}
}
